1. Field of the Invention
The present invention relates to image processing and, more particularly, to image processing for reproducing a code image, such as a two-dimensional barcode image, from original information.
2. Description of the Related Art
The number of occasions is increasing, where a code image (digital watermarking image, two-dimensional barcode image, barcode image, steganography, etc.) is combined with a document image for printing using a multifunction printer (MFP).
The MFP creates a code image by adding an error correcting code to original information to obtain code-added information and constructing an image from the code-added information, so that the original information can be extracted later from the code image without fail. In the present specification, adding an error correcting code is referred to as error correction coding. Further, “adding an error correcting code to obtain code-added information and constructing an image from the code-added information” is referred to as code image construction.
As described above, by adding an error correcting code to original information, it is possible to extract the original information from a damaged code image in printed matter even if the code image in the printed matter has been damaged (for example, stained).
Here, the Reed-Solomon code will be described as an example of an error correcting code used for two-dimensional codes.
In the Reed-Solomon code, an error correcting rate is obtained by (½)×(amount of original information)/(amount of original information+amount of error correcting code). With this arrangement, in the Reed-Solomon code, for example, when the amount of original information is the same as the amount of error correcting code, the error correcting rate is 25%.
An error correcting rate of 25% means that it is possible to accurately extract the original information even if 25% of the two-dimensional code has been damaged. However, the size of the two-dimensional code with an error correcting rate of 25% is double that of the two-dimensional code with an error correcting rate of 0% (coded image constructed from original information without the addition of the error correcting code to the original information).
That is, on one hand, there is an advantage that, when the error correcting rate is high, the original information can be obtained correctly even if the two-dimensional code is damaged. On the other hand, there is however a disadvantage that the two-dimensional code becomes large in size. At a result, the ratio of the amount of error correcting code to the amount of original information is usually determined in consideration of the balance between them.
Japanese Patent Laid-Open No. 7-254037 (1995) discloses a method for producing a two-dimensional barcode.
Conventionally, there has been a problem that the two-dimensional code is damaged more than the error correcting rate in copying a code image with a high error correcting rate (two-dimensional barcode image). If the two-dimensional code is damaged more than the error correcting rate, error correction is no longer available and therefore it is no longer possible to extract the original information of the code image. For example, this problem arises in a second-generation copy after first generation copying is repeated.
The situation in which the extraction of original information from a code image is no longer available is referred to as the occurrence of extraction error in this specification. The “error detecting rate” indicates the ratio of the area of the damaged code image to the total area of the code image. This ratio refers to a ratio of the amount of information that requires error correction by an error correcting code to the amount of original information.